home *** CD-ROM | disk | FTP | other *** search
- /*******************************************************************************
- * Module : TESTMALL.H *
- *------------------------------------------------------------------------------*
- * Program : DEBUG UTILITY *
- *------------------------------------------------------------------------------*
- * Author : M.R.Watson. (maff@cix) *
- *------------------------------------------------------------------------------*
- * Version : 1.0 *
- *------------------------------------------------------------------------------*
- * Legal Status : Public Domain. *
- *------------------------------------------------------------------------------*
- * Last Updated : 05/07/92 *
- *==============================================================================*
- * #include this module in any sources where you want to check the mallocs etc. *
- * You will need to link with the "TESTMALL.C" module, and *
- * set extern int DebugMalloc to TRUE. *
- *******************************************************************************/
-
- #if !defined(__TESTMALL_H)
-
- #define __TESTMALL_H
-
- #if defined (DBG_MALLOC)
-
- #define malloc(x) mymalloc((unsigned)(x),__FILE__,__LINE__)
- #define calloc(x,y) mycalloc((unsigned)(x),(int)(y),__FILE__,__LINE__)
- #define free(x) myfree((unsigned char *)(x),__FILE__,__LINE__)
- #define chmall(x) CheckMalloc((char*)(x),__FILE__,__LINE__)
- #define chfree() CheckFree(__FILE__,__LINE__)
- #define testmall(f) TestMalloc(f,__FILE__,__LINE__)
-
- void CheckMalloc( char *p, char *filename, int linenum );
- void myfree( unsigned char *p, char *filename, int linenum );
- void *mycalloc( size_t size, int count, char *filename, int linenum );
- void *mymalloc( size_t size, char *filename, int linenum );
- void TestMalloc( int blocks, char *filename, int linenum );
- void CheckFree( char *file, int line );
- void SetOverlap( int over );
- void SetDebugMallocLevel( int level );
- void mem_report (void);
-
- #else
-
- #define malloc(x) xmalloc(x)
-
- #endif
-
- #endif
-
-